package 设计模式.chainofres;

/**
 * @功能
 * 主任
 * @创建时间 2020/5/4
 */
public class Director extends Leader {
    public Director(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveRequest request) {
        if(request.getLeaveDays()<3){
            System.out.println("员工:"+request.getEmpName()+"请假天数"+request.getLeaveDays()+"请假理由"+request.getReason());
            System.out.println("主任:"+name+"批准");
        }else {
            if(this.nextLeader!=null){
                this.nextLeader.handleRequest(request);
            }
        }
    }
}
